package cn.whb.hrm.feign;

import cn.whb.hrm.domain.LoginUser;
import cn.whb.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RegisterFallback implements FallbackFactory<RegisterFeignClient>{
    @Override
    public RegisterFeignClient create(Throwable throwable) {
        return new RegisterFeignClient() {
            @Override
            public AjaxResult register(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("注册失败，请稍后再试");
            }
        };
    }
}
